package org.jeecg.modules.strategy.util;

public class SpiderUtil {
    public String getContentTest(String meta) {
        String contentTest;
        if (meta.contains("content='")) {
            int contentSubstringStart = meta.indexOf("content='") + "content='".length();
            int contentSubstringEnd = meta.indexOf(">", contentSubstringStart);
            contentTest = meta.substring(contentSubstringStart, contentSubstringEnd);
        } else if (meta.contains("content=“")){
            int contentSubstringStart = meta.indexOf("content=“") + "content=“".length();
            int contentSubstringEnd = meta.indexOf(">", contentSubstringStart);
            contentTest = meta.substring(contentSubstringStart, contentSubstringEnd);
        } else {
            contentTest = meta.substring(meta.indexOf("content=\"") + "content=\"".length(), meta.indexOf("\">"));
        }
        return contentTest;
    }
}
